Skip to content

Conversation

@bonzini
Copy link
Collaborator

@bonzini bonzini commented Nov 28, 2025

Attempting to use LTO on a procedural macro crate fails with

error: lto cannot be used for proc-macro crate type without -Zdylib-lto

This is new in 1.10 because earlier versions did not support LTO for Rust. Automatically override -Db_lto in the rust.proc_macro method.

@bonzini bonzini requested a review from jpakkane as a code owner November 28, 2025 22:30
@bonzini bonzini added this to the 1.10 milestone Nov 28, 2025
@bonzini bonzini added regression language:rust module:rust Specific to the Rust module labels Nov 28, 2025
Attempting to use LTO on e.g. a procedural macro crate fails with

  error: lto cannot be used for proc-macro crate type without -Zdylib-lto

Do not return -Clto for such crate types.

Signed-off-by: Paolo Bonzini <[email protected]>
@bonzini bonzini force-pushed the rust-proc-macro-disable-lto branch from 30f0d90 to 1883fbb Compare November 28, 2025 23:17
@bonzini bonzini requested a review from dcbaker as a code owner November 28, 2025 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant